import {ScrollView, View, Text, Image, WebView} from '@tarojs/components';
import React, {Component} from 'react';
import Taro, {getCurrentInstance} from '@tarojs/taro';
import {connect} from 'react-redux';
import * as T from './types';
import actions from './actions';
import {store2Props} from './selectors';

actions().actions.loadReducer();
// @ts-ignore
@connect<Partial<T.IProps>, any>(store2Props, actions)
export default class Index extends Component<Partial<T.IProps>, any> {
  constructor(props) {
    super(props);
    this.state = {
      url: '',
    };
  }

  componentDidMount() {
    const getUrl = Taro.getStorageSync('url');
    console.log('getUrl===', getUrl);
    this.setState({
      url: getUrl,
      // url:'https://www.daoway.cn/newh5/#/search_service?filter=20&channel=rykj&phone=15222922579&sign=6d5047969af45e81c333de7b882483a4&nav=0&top=0&banner=0'
      // url:'https://www.daoway.cn/newh5/?channel=rykj&phone=15222922579&sign=6d5047969af45e81c333de7b882483a4&nav=0&top=1&banner=0'
    });
  }

  componentDidShow() {}

  componentWillUnmount() {}

  render() {
    const {url} = this.state;
    return <WebView src={url} />;
  }
}
